The optical scanner used in an image forming apparatus to form an electrostatic latent image on a photoconductive drum uses a Micro Electro Mechanical System (MEMS) mirror. Sometimes, the drive position of the MEMS mirror is deviated for the change in temperature or the secular change of the MEMS mirror. Thus, the optical scanner needs to detect the drive position of the MEMS mirror. However, sometimes, to detect the drive position of the MEMS mirror, another optical sensor such as a light beam detection sensor must be provided for laser detection, thus increasing the cost of the optical scanner.